<template>
	<view class="guide-wrap">
		<view class="guide-title">优惠券使用规则：</view>
		<view class="guide-tips">使用时间：</view>
		<view class="guide-content">{{useTimeStart}}~{{useTimeEnd}}</view>
		<view class="guide-tips">使用规则：</view>
		<view class="guide-content">
			<u-parse :html="useDesc" :lazy-load="true" :show-with-animation="true"></u-parse>
		</view>
	</view>
</template>

<script>
	import {
		getCouponDetail
	} from "@/api/activity";
	export default {
		data() {
			return {
				id:"",
				useTimeStart: "",
				useTimeEnd: "",
				useDesc: ""
			}
		},
		onLoad() {
			const options = this.$Route.query;
			if (options && options.scene) {
				const scene = strToParams(decodeURIComponent(options.scene));
				options.id = scene.id;
			}
			this.id = options.id;
			this.getCouponDetailFun();
		},
		methods: {
			getCouponDetailFun() {
				getCouponDetail({
					coupon_id: this.id
				}).then((res) => {
					if (res.code == 1) {
						this.useTimeStart = res.data.use_time_start;
						this.useTimeEnd = res.data.use_time_end;
						this.useDesc = res.data.use_desc;
					} else {
						this.$toast({
							title: res.msg
						});
					}
				});
			}
		}
	}
</script>

<style lang="scss">
	.guide-wrap {
		padding: 50rpx;

		.guide-title {
			margin-bottom: 30rpx;
			font-size: 32rpx;
		}

		.guide-tips {
			margin-top: 30rpx;
			margin-bottom: 15rpx;
			font-size: 28rpx;
		}

		.guide-content {
			margin-bottom: 15rpx;
			font-size: 26rpx;
		}
	}
</style>